package com.itacademy.cinnamonreader;


import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.ListFragment;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.widget.Toast;

import com.itacademy.cinnamonreader.fragments.MyFragmentPagerAdapter;
import com.itacademy.cinnamonreader.fragments.onFeedsFragmentEventListener;


public class MainActivity extends FragmentActivity 
			implements onFeedsFragmentEventListener {


	  static final int PAGE_COUNT = 3;
	  private ViewPager pager;
	  private PagerAdapter pagerAdapter;
	  private ListFragment itemsList;

	  @Override
	  protected void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);

	    pager = (ViewPager) findViewById(R.id.pager);
	    pagerAdapter = new MyFragmentPagerAdapter(this,pager,PAGE_COUNT);
	  }
	  
	  @Override
	  public void someEvent(int position) {
		    Toast.makeText(this, "position = " + position, Toast.LENGTH_SHORT).show();
		    pager.setCurrentItem(1);
	  }
	  
	
}
